import React, { Component } from 'react';
import { Provider } from 'react-redux'
import { BrowserRouter, Route } from 'react-router-dom'
import { GlobalStyle } from "./style.js";
import Header from './common/header/index.js'
import Home from './page/home/index.js'
import Detail from './page/detail/index.js'
import Login from './page/login/index.js'
import Write from './page/write/index.js'
import store from './store'
class App extends Component {
  render() {
    return (
      <div className="App">
        <GlobalStyle />
        <Provider store={store}>
          <BrowserRouter>
            <div>
              <Header />
              <Route path="/" exact component={Home}></Route>
              <Route path="/login" exact component={Login}></Route>
              <Route path="/write" exact component={Write}></Route>
              <Route path="/detail/:id" exact component={Detail}></Route>
            </div>
          </BrowserRouter>
        </Provider>
      </div>
    );
  }
}

export default App;
